
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/install.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:23:00 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Installation &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/default.css" />
    <link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="../../live.sympy.org/static/utilities.js"></script>
    <script src="../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../live.sympy.org/static/live-core.js"></script>
    <script src="../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="_static/sympy-notailtext-favicon.ico"/>
    <link href="install.html" rel="canonical" />
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="SymPy Tutorial" href="tutorial/index.html" />
    <link rel="prev" title="Welcome to SymPy’s documentation!" href="index.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="tutorial/index.html" title="SymPy Tutorial"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Welcome to SymPy’s documentation!"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">SymPy 1.9 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Installation</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="installation">
<span id="id1"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
<p>The SymPy CAS can be installed on virtually any computer with Python.
SymPy does require <a class="reference external" href="http://mpmath.org/">mpmath</a> Python library to be installed first.  The
recommended method of installation is through Anaconda, which includes
mpmath, as well as several other useful libraries.  Alternatively, some Linux
distributions have SymPy packages available.</p>
<p>SymPy officially supports Python 3.5, 3.6, 3.7, and PyPy.</p>
<section id="anaconda">
<h2>Anaconda<a class="headerlink" href="#anaconda" title="Permalink to this headline">¶</a></h2>
<p><a class="reference external" href="https://www.anaconda.com/download/">Anaconda</a> is a free Python distribution from
Continuum Analytics that includes SymPy, Matplotlib, IPython, NumPy, and many
more useful packages for scientific computing. This is recommended because
many nice features of SymPy are only enabled when certain libraries are
installed.  For example, without Matplotlib, only simple text-based plotting
is enabled.  With the IPython notebook or qtconsole, you can get nicer
<span class="math notranslate nohighlight">\(\mathrm{\LaTeX}\)</span> printing by running <code class="docutils literal notranslate"><span class="pre">init_printing()</span></code>.</p>
<p>If you already have Anaconda and want to update SymPy to the latest version,
use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">update</span> <span class="n">sympy</span>
</pre></div>
</div>
</section>
<section id="git">
<h2>Git<a class="headerlink" href="#git" title="Permalink to this headline">¶</a></h2>
<p>If you wish to contribute to SymPy or like to get the latest updates as they
come, install SymPy from git. To download the repository, execute the
following from the command line:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">sympy</span><span class="o">/</span><span class="n">sympy</span><span class="o">.</span><span class="n">git</span>
</pre></div>
</div>
<p>To update to the latest version, go into your repository and execute:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">pull</span> <span class="n">origin</span> <span class="n">master</span>
</pre></div>
</div>
<p>If you want to install SymPy, but still want to use the git version, you can run
from your repository:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="n">setupegg</span><span class="o">.</span><span class="n">py</span> <span class="n">develop</span>
</pre></div>
</div>
<p>This will cause the installed version to always point to the version in the git
directory.</p>
</section>
<section id="other-methods">
<h2>Other Methods<a class="headerlink" href="#other-methods" title="Permalink to this headline">¶</a></h2>
<p>You may also install SymPy using pip or from source. In addition, most Linux
and Python distributions have some SymPy version available to install using
their package manager. Here is a list of several such Python distributions:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.anaconda.com/download/">Anaconda</a></p></li>
<li><p><a class="reference external" href="https://www.enthought.com/product/canopy/">Enthought Canopy</a></p></li>
<li><p><a class="reference external" href="https://www.activestate.com/activepython">ActivePython</a></p></li>
<li><p><a class="reference external" href="https://spack.io/">Spack</a></p></li>
</ul>
</section>
<section id="run-sympy">
<h2>Run SymPy<a class="headerlink" href="#run-sympy" title="Permalink to this headline">¶</a></h2>
<p>After installation, it is best to verify that your freshly-installed SymPy
works. To do this, start up Python and import the SymPy libraries:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ python
&gt;&gt;&gt; from sympy import *
</pre></div>
</div>
<p>From here, execute some simple SymPy statements like the ones below:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">limit</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">log(x)</span>
</pre></div>
</div>
<p>For a starter guide on using SymPy effectively, refer to the <a class="reference internal" href="tutorial/index.html#tutorial"><span class="std std-ref">SymPy Tutorial</span></a>.</p>
</section>
<section id="mpmath">
<h2>Mpmath<a class="headerlink" href="#mpmath" title="Permalink to this headline">¶</a></h2>
<p>Versions of SymPy prior to 1.0 included <a class="reference external" href="http://mpmath.org/">mpmath</a>, but it now depends on it as
an external dependency.  If you installed SymPy with Anaconda, it will already
include mpmath. Use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">install</span> <span class="n">mpmath</span>
</pre></div>
</div>
<p>to ensure that it is installed.</p>
<p>If you do not wish to use Anaconda, you can use <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">mpmath</span></code>.</p>
<p>If you use mpmath via <code class="docutils literal notranslate"><span class="pre">sympy.mpmath</span></code> in your code, you will need to change
this to use just <code class="docutils literal notranslate"><span class="pre">mpmath</span></code>. If you depend on code that does this that you
cannot easily change, you can work around it by doing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">mpmath</span>
<span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="s1">&#39;sympy.mpmath&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">mpmath</span>
</pre></div>
</div>
<p>before the code that imports <code class="docutils literal notranslate"><span class="pre">sympy.mpmath</span></code>. It is recommended to change
code that uses <code class="docutils literal notranslate"><span class="pre">sympy.mpmath</span></code> to use <code class="docutils literal notranslate"><span class="pre">mpmath</span></code> directly wherever possible.</p>
</section>
<section id="questions">
<h2>Questions<a class="headerlink" href="#questions" title="Permalink to this headline">¶</a></h2>
<p>If you have a question about installation or SymPy in general, feel free to
visit our chat on <a class="reference external" href="https://gitter.im/sympy/sympy">Gitter</a>. In addition, our <a class="reference external" href="https://groups.google.com/forum/#!forum/sympy">mailing list</a> is an excellent
source of community support.</p>
<p>If you think there’s a bug or you would like to request a feature, please open
an <a class="reference external" href="https://github.com/sympy/sympy/issues">issue ticket</a>.</p>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Installation</a><ul>
<li><a class="reference internal" href="#anaconda">Anaconda</a></li>
<li><a class="reference internal" href="#git">Git</a></li>
<li><a class="reference internal" href="#other-methods">Other Methods</a></li>
<li><a class="reference internal" href="#run-sympy">Run SymPy</a></li>
<li><a class="reference internal" href="#mpmath">Mpmath</a></li>
<li><a class="reference internal" href="#questions">Questions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Welcome to SymPy’s documentation!</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="tutorial/index.html"
                        title="next chapter">SymPy Tutorial</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/install.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="tutorial/index.html" title="SymPy Tutorial"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Welcome to SymPy’s documentation!"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">SymPy 1.9 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Installation</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/install.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:23:16 GMT -->
</html>